from typing import Dict, List
import os

PROCESSES_SCRIPTS = [
    "processes_僵尸进程累积.sh",
    "processes_进程资源泄漏.sh"
]

def select_script_for_anomaly(anomaly: Dict) -> str:
    root_cause = anomaly.get("root_cause", "").lower()
    evidence = " ".join(anomaly.get("evidence", [])).lower()
    if "僵尸" in root_cause or "zombie" in root_cause or "僵尸进程" in root_cause:
        return "processes_僵尸进程累积.sh"
    if "资源泄漏" in root_cause or "leak" in root_cause or "泄漏" in root_cause:
        return "processes_进程资源泄漏.sh"
    return PROCESSES_SCRIPTS[0] 